home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.june.archive / 000144_crash!minyos.xx….OZ.AU!s924723_Sat, 26 Jun 93 19:46:18 PST.msg < prev    next >
Text File  |  1993-08-31  |  2KB  |  50 lines

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Sat, 26 Jun 93 19:46:18 PST
  3. Received: from peladon.rmit.OZ.AU by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #15) id m0o9lor-00003rC; Sat, 26 Jun 93 18:46 PDT
  5. Received: from minyos.xx.rmit.OZ.AU by peladon.rmit.OZ.AU with SMTP id AA10656
  6.   (5.65c/IDA-1.4.4 for <amigae@bkhouse.cts.com>); Sun, 27 Jun 1993 11:46:06 +1000
  7. Received: by minyos.xx.rmit.oz.au
  8. Date: Sun, 27 Jun 93 11:46:10 EST
  9. Message-Id: <9306270146.7957@minyos.xx.rmit.oz.au>
  10. From: s924723@minyos.xx.rmit.OZ.AU (Son Huu Le)
  11. To: amigae@bkhouse.cts.com
  12. Subject: Random
  13.  
  14.  
  15. Just like to put in my bit.
  16.  
  17. First using DateStamp to generate a random seed. [Actually it isn't truly
  18. random. (But then again, what is? :) It's just an increasing counter (1-3000)
  19. which is increased every 1/50 of a second.]
  20.  
  21. MODULE 'dos/dos'
  22.  
  23. PROC main()
  24. DEF ds:datestamp, x
  25.   DateStamp(ds)
  26.  
  27.   /* Don't know why, but just plain (-ds.tick) _always_ generate a zero as */
  28.   /* the second random number on my system. Maybe it's too small for seed? */
  29.  
  30.   Rnd(-ds.tick*ds.tick)
  31.  
  32.   FOR x:=1 TO 20 DO WriteF('\t\d\t\d\t\d\n',Rnd(1000),Rnd(1000),Rnd(1000))
  33. ENDPROC
  34.  
  35.  
  36. Second method uses the Vertical Beam Position as a random seed. The beam
  37. position is obtained from the graphics library call VBeamPos(). It ranges
  38. from 0 to 312 (what does this mean, compared to 1-3000? dunno! :)
  39.  
  40. PROC main()
  41. DEF x
  42.  
  43.   /* Same problem here as above. Remove the *VbeamPos() to see what I mean */
  44.  
  45.   Rnd(-VbeamPos()*VbeamPos())
  46.   FOR x:=1 TO 20 DO WriteF('\t\d\t\d\t\d\n',Rnd(1000),Rnd(1000),Rnd(1000))
  47. ENDPROC
  48.  
  49. TaDa!
  50. Son Le